﻿using AsterNET.Extensions.FastAGI.Helpers;
using AsterNET.FastAGI;
using AsterNET.FastAGI.Command;
using System;
using System.Reflection;

namespace AsterNET.Extensions.FastAGI.ExtensionMethods
{
    public static class ExtensionMethodHelpers
    {
        public static T GetPrivateProperty<T>(this object obj, string name)
        {
            const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
            var type = obj.GetType();
            var field = type.GetProperty(name, flags);
            return (T)field.GetValue(obj, null);
        }
    }
}
